import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children:[
      {
        path:"/",
        redirect:"/index"
      },
      {
        path:"/index",
        name:"index",
        component:Index,
        meta:{
          title: "每时每刻"
        }
      },
      {
        path: "/course",
        name: "course",
        component: () => import("../views/course.vue"),
        meta: {
          title: "特色课"
        }
      },
      {
        path: "/record",
        name: "record",
        component: () => import("../views/record.vue"),
        meta: {
          title: "约课记录"
        }
      },
      {
        path: "/practice",
        name: "practice",
        component: () => import("../views/practice.vue"),
        meta: {
          title: "练习"
        }
      },
      {
        path: "/mine",
        name: "mine",
        component: () => import("../views/mine.vue"),
        meta: {
          title: "我的"
        }
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login.vue"),
    meta: {
      title: "登录"
    }
  },
  {
    path: "/smslogin",
    name: "smslogin",
    component: () => import("../views/login/Smslogin.vue"),
    meta: {
      title: "验证码登录"
    }
  },
  {
    path: "/setpass",
    name: "setpass",
    component: () => import("../views/login/setpass.vue"),
    meta: {
      title: "设置密码"
    }
  },
  {
    path: "/options",
    name: "options",
    component: () => import("../views/mine/option.vue"),
    meta: {
      title: "设置信息"
    }
  },
  {
    path: "/setnewpass",
    name: "setnewpass",
    component: () => import("../views/mine/setnewpass.vue"),
    meta: {
      title: "设置密码"
    }
  },
  {
    path: "/mystudy",
    name: "mystudy",
    component: () => import("../views/mine/mystaus.vue"),
    meta: {
      title: "我的学习"
    }
  },
  {
    path: "/studyCalendar",
    name: "studyCalendar",
    component: () => import("../views/mine/study-calendar.vue"),
    meta: {
      title: "学习日历"
    }
  },
  {
    path: "/info",
    name: "info",
    component: () => import("../views/mine/info.vue"),
    meta: {
      title: "个人信息"
    }
  },
  {
    path: "/setinfo",
    name: "setinfo",
    component: () => import("../views/mine/setinfo.vue"),
    meta: {
      title: "修改个人信息"
    }
  },
  {
    path: "/Concern",
    name: "Concern",
    component: () => import("../views/mine/Concern.vue"),
    meta: {
      title: "我的关注"
    }
  },
  {
    path: "/Collect",
    name: "Collect",
    component: () => import("../views/mine/Collect.vue"),
    meta: {
      title: "我的收藏"
    }
  },
  {
    path:"/teacherDetail",
    name: 'teacherDetail',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/teacherDetail.vue')
  },
  {
    path: "/courceDetail",
    name: "courceDetail",
    component: () => import("../views/courceDetail.vue"),
    meta: {
      title: "课程详情"
    }
  },
  {
    path: "/search",
    name: "search",
    component: () => import("../views/course/Search.vue"),
    meta: {
      title: "搜索"
    }
  },
  {
    path: "/coursedet",
    name: "coursedet",
    component: () => import("../views/index/swiperId.vue"),
    meta: {
      title: "课程详情"
    }
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
